# Contributor: Maxim Karasev <mxkrsv@disroot.org>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=oxipng
pkgver=9.0.0
pkgrel=0
pkgdesc="Multithreaded PNG optimizer written in Rust"
url="https://github.com/shssoichiro/oxipng"
# armhf: does not build here, and useless
arch="all !armhf"
license="MIT"
makedepends="cargo cargo-auditable"
source="https://github.com/shssoichiro/oxipng/archive/v$pkgver/oxipng-$pkgver.tar.gz"

prepare() {
	default_prepare

	# forces qemu-aarch64 on aarch64 (why??)
	rm .cargo/config.toml

	cargo fetch --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/oxipng -t "$pkgdir"/usr/bin/
}

sha512sums="
ac12b1e823c748b5a3d58081b86d5be69b970788fb3f2d4acc1db1f790455bd35b8b897203b1157674be83b9172bb4cb3ec1d6401538270f42a5f35f92a62f5a  oxipng-9.0.0.tar.gz
"
